package greedy.总结.基础;

public class leetcode1217玩筹码 {
    public int minCostToMoveChips(int[] position) {
        int odd = 0;
        int length = position.length;
        for (int i = 0; i < length; i++) {
            if (position[i] % 2 == 1) {
                odd++;
            }
        }
        int even = length - odd;
        return Math.min(odd, even);
    }
}
